function longest(s1, s2) {
    return [...new Set(s1+s2)].sort().join('')
}
  
let a = "xyaabbbccccdefww"
let b = "xxxxyyyyabklmopq"
console.log(longest(a,b))